﻿namespace Blazor.Core.Disposable;

public struct StructDefaultDisposable(Action callback) : IDisposable
{
    private bool _disposed;


    public void Dispose()
    {
        if (_disposed)
        {
            return;
        }
        
        callback.Invoke();
        _disposed = true;
    }
}